﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls.Maps;
using System.Device.Location;

namespace MapTest.Element
{
    public class PushpinLayer
    {
        public MapLayer layer { get; set; }
        public PushpinLayer()
        {
            layer = new MapLayer();
        }
        public PushpinLayer(MapLayer layer)
        {
            this.layer = layer;
        }
        public Pushpin AddChild(string Name, string DataContext, GeoCoordinate location)
        {
            Pushpin pushpin = new Pushpin();
            pushpin.Visibility = System.Windows.Visibility.Visible;
            pushpin.DataContext = DataContext;
            pushpin.Name = Name;
            pushpin.Background = new SolidColorBrush(Colors.Blue);
            pushpin.Location = location;
            layer.AddChild(pushpin, location);

            return pushpin;
        }
    }
}
